package com.training.food.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.training.food.Mapper.CheckMapper;
import com.training.food.pojo.Check;
import com.training.food.pojo.Slaughter;
import com.training.food.service.CheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CheckServiceImpl extends ServiceImpl<CheckMapper, Check> implements CheckService {
    @Autowired
    CheckMapper checkMapper;
    @Override
    public boolean select(Check check) {
        if(checkMapper.select(check)!=null)return true;
        return false;
    }

    @Override
    public Integer add(Check check) {
        checkMapper.insertCheck(check);
        return check.getCheckId();
    }

    @Override
    public void sub(Check check) {
        checkMapper.delete(check);
    }

    @Override
    public List<Check> checks(Slaughter slaughter) {
        return checkMapper.checks(slaughter);
    }
}
